Framework / Compression / Compression Overview
In This Topic
    Compression Overview
    In This Topic

    Nevron Open Vision (NOV) provides support for the most common compression algorithms:

    The compression and decompression routines for the various compression algorithms are exposed through the NCompression static class. The source code below demonstrates how to compress and decompress a stream into the zlib format:

    Zlib Compression and Decompression
    Copy Code
    // Compress the input stream
    NCompression.CompressZlib(inputStream, compressedStream, ENCompressionLevel.BestCompression);
     
    // Decompress the compressed stream
    NCompression.DecompressZlib(compressedStream, decompressedStream);
    

    As the example above demonstrates, the compression method accepts as a parameter the compression level to apply. This is common for the zlib and the zip compression. The possible values are:

    ENCompressionLevel Description
    NoCompression This level won't compress at all but output uncompressed blocks.
    BestSpeed The worst but fastest compression level.
    MediumCompression This level is a compromise between speed and compression ratio.
    BestCompression The best and slowest compression level. This tries to find very long and distant string repetitions.
    See Also